
package{
	
import mx.controls.Label; 
    import mx.controls.DataGrid; 
    import mx.controls.dataGridClasses.*; 
    import flash.display.Graphics; 

    public class renderBackColor extends Label { 
    	
    	
		public function renderBackColor(){
			
			//setStyle("verticalAlign", "middle");
			
		}
		
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void 
        { 
            super.updateDisplayList(unscaledWidth, unscaledHeight); 
            var grid1:DataGrid = DataGrid(DataGridListData(listData).owner); 
            if (grid1.isItemSelected(data) || grid1.isItemHighlighted(data)) 
                return; 
                
            //if (data[DataGridListData(listData).dataField] > 100) 
            if (data.cellColorFunction)
            { 
	            var g:Graphics = graphics; 
	            g.clear(); 
                g.beginFill(data.cellColorFunction(data, DataGridListData(listData).columnIndex, DataGridListData(listData).rowIndex)); 
				g.drawRect(0, 0, unscaledWidth+3, unscaledHeight+3); 
                g.endFill(); 
                
            } 
        } 
    }
    	
}
    
